home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / DTA-ALL.TXT < prev    next >
Text File  |  1996-07-04  |  3KB  |  64 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   DTA-ALL .TXT ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. There are several functions included in this library that create, load and
  22. use a "DTA" ( Data Transfer Area ). These functions were created in support
  23. of fDIR$, fDIRlist%, and the fTREExxx functions but are available to you
  24. also.
  25.  
  26. Before using the DTA you must first understand just how DOS works when you
  27. request directory information:
  28.  
  29. First an area of memory is set aside, by DOS, to load the information on
  30. the requested file into. It is then your job to access this area, read and
  31. unpack the data. When you call fDIRfirstFile% the DTA is set and, if a file
  32. match is found, it's data is loaded into this area. With each subsequent
  33. call to fDIRnextFile% the next file's info is loaded into the DTA until the
  34. last matching file has been passed.
  35.  
  36. Getting the info out of the DTA and into some usable form is handled by a
  37. series of small functions:  fDTAfile$   file's name
  38.                             fDTAattr?   file's attribute
  39.                             fDTAtime??  time stored
  40.                             fDTAdate??  date stored
  41.                             fDTAsize&   size in bytes
  42. To make things more compatible with our time and date routines there are
  43. two functions that return the files' time/date in their component parts:
  44.                              DTA2HMS
  45.                              DTA2YMD
  46. Now, there are 3 other routines that make the fTREExxx functions work but
  47. unless you are adventurous or know what you are about I would advise you
  48. simply ignoring them for safety's sake!
  49.                             fDTAPTR??? far pointer to the DTA
  50.                             fDTAget$   the DTA data
  51.                              DTAput    overwrite DTA data
  52.  
  53. There are also 2 higher order functions:
  54.   fFileAttr$  which converts fDTAattr? into a string eg: "A..."
  55.   fDTAunpack$ which converts all DTA data into a requested format
  56. Of these, fDTAunpack$ is the one that makes calls to all the rest
  57. unnecessary as it will unpack the DTA into any directory format you
  58. can conceive! You only need call fDTAfirstFile and fDTAnextFile to load
  59. the DTA first.
  60.  
  61. <<<BUT>>>
  62.  
  63. fDIR$, fDIRlist%, & fTREExxx will do it ALL for you automatically so.......
  64.